+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
+Mon Mar 26 15:48:45 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwindow.c (gtk_window_list_toplevels): Don't
+ reference the widgets in the resulting list. (#11821)
+ This makes this consistent with gtk_container_children.
+
+ * gtk/gtkwindow.c gtk/gtkwidget.c: Fix up the two
+ uses of gtk_window_list_toplevels.
+
Mon Mar 26 15:26:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c (gtk_im_context_set_use_preedit): Add
gtk_default_direction = dir;
tmp_list = toplevels = gtk_window_list_toplevels ();
+ g_list_foreach (toplevels, (GFunc)g_object_ref, NULL);
+
while (tmp_list)
{
gtk_widget_set_default_direction_recurse (tmp_list->data,
}
g_list_free (toplevels);
-
}
}
/**
* gtk_window_list_toplevels:
*
- * Returns a list of all existing toplevel windows. Each widget
- * in the list has a reference added to it; to free the
- * list, first unref each widget in the list, then free the list.
+ * Returns a list of all existing toplevel windows. The widgets
+ * in the list are not individually referenced. If you want
+ * to iterate through the list and perform actions involving
+ * callbacks that might destroy the widgets, you MUST call
+ * g_list_foreach (result, (GFunc)g_object_ref, NULL) first, and
+ * then unref all the widgets afterwards.
*
- * Return value: list of referenced toplevel widgets
+ * Return value: list of toplevel widgets
**/
GList*
gtk_window_list_toplevels (void)
GSList *slist;
for (slist = toplevel_list; slist; slist = slist->next)
- list = g_list_prepend (list, gtk_widget_ref (slist->data));
+ list = g_list_prepend (list, slist->data);
return list;
}
_gtk_icon_set_invalidate_caches ();
toplevels = gtk_window_list_toplevels ();
+ g_list_foreach (toplevels, (GFunc)g_object_ref, NULL);
for (list = toplevels; list; list = list->next)
{